jQuery(document).ready(function() {
	
	//创建JQGRID表格
	var grid = $("#table1").ligerGrid({
        columns: [
                  { display: '盘点任务单号', name: 'checkMissionCode', width: 150 },
                  { display: '盘点单号', name: 'checkCode', width: 150 },
                  { display: '盘点人', name: 'agent', width: 100 },
                  { display: '仓库编码', name: 'whCode', width: 150},
                  { display: '盘点仓库', name: 'whName', width: 150},
                  { display: '物料编码', name: 'code', width: 120},
                  { display: '物料名称', name: 'name', width: 120},
                  { display: '物料类型', name: 'maType', width: 100},
                  { display: '型号', name: 'spec', width: 270},
                  { display: '单位', name: 'unit', width: 100 },
                  { display: '批次', name: 'batch', width: 120},
                  { display: '总库存数量', name: 'quantityWH', width: 100 ,render:function(row){
                	  if(row.quantityWH == null || parseFloat(row.quantityWH) == 0){
                		  return '0.0';
                	  }else{
                		  return row.quantityWH;
                	  }
                  }}, { display: '总盘点数量', name: 'quantityPD', width: 100 ,render:function(row){
                	  if(row.quantityPD == null || parseFloat(row.QuantityPD) == 0){
                		  return '0.0';
                	  }else{
                	  	return row.quantityPD;
                	  }
                  }},
                  { display: '总差异数量', name: 'quantityCY', width: 100 ,render:function(row){
                	  if(row.quantityCY == null || parseFloat(row.quantityCY) == 0){
                		  return '0.0';
                	  }else{
                		  return row.quantityCY;
                	  }
                  }},
                  { display: '一等品库存数量', name: 'ydengQuantityWH', width: 100 ,render:function(row){
                	  if(row.ydengQuantityWH == null || parseFloat(row.ydengQuantityWH) == 0){
                		  return '0.0';
                	  }else{
                		  return row.ydengQuantityWH;
                	  }
                  }}, { display: '一等品盘点数量', name: 'ydengQuantityPD', width: 100 ,render:function(row){
                	  if(row.ydengQuantityPD == null || parseFloat(row.ydengQuantityPD) == 0){
                		  return '0.0';
                	  }else{
                	  	return row.ydengQuantityPD;
                	  }
                  }},
                  { display: '一等品差异数量', name: 'ydengQuantityCY', width: 100 ,render:function(row){
                	  if(row.ydengQuantityCY == null || parseFloat(row.ydengQuantityCY) == 0){
                		  return '0.0';
                	  }else{
                		  return row.ydengQuantityCY;
                	  }
                  }},
                  { display: '次品库存数量', name: 'cipinQuantityWH', width: 100 ,render:function(row){
                	  
                	  if(row.cipinQuantityWH == null || parseFloat(row.cipinQuantityWH) == 0){
                		  return '0.0';
                	  }else{
                		  return row.cipinQuantityWH;
                	  }
                  }}, { display: '次品盘点数量', name: 'cipinQuantityPD', width: 100 ,render:function(row){
                	  if(row.cipinQuantityPD == null || parseFloat(row.cipinQuantityPD) == 0){
                		  return '0.0';
                	  }else{
                	  	return row.cipinQuantityPD;
                	  }
                  }},
                  { display: '次品差异数量', name: 'cipinQuantityCY', width: 100 ,render:function(row){
                	  
                	  if(row.cipinQuantityCY == null || parseFloat(row.cipinQuantityCY) == 0){
                		  return '0.0';
                	  }else{
                		  return row.cipinQuantityCY;
                	  }
                  }},
                  { display: '旧品库存数量', name: 'jiupinQuantityWH', width: 100 ,render:function(row){
                	  
                	  if(row.jiupinQuantityWH == null || parseFloat(row.jiupinQuantityWH) == 0){
                		  return '0.0';
                	  }else{
                		  return row.jiupinQuantityWH;
                	  }
                  }}, { display: '旧品盘点数量', name: 'jiupinQuantityPD', width: 100 ,render:function(row){
                	  if(row.jiupinQuantityPD == null || parseFloat(row.jiupinQuantityPD) == 0){
                		  return '0.0';
                	  }else{
                	  	return row.jiupinQuantityPD;
                	  }
                  }},
                  { display: '旧品差异数量', name: 'jiupinQuantityCY', width: 100 ,render:function(row){
                	  
                	  if(row.jiupinQuantityCY == null || parseFloat(row.jiupinQuantityCY) == 0){
                		  return '0.0';
                	  }else{
                		  return row.jiupinQuantityCY;
                	  }
                  }},
                  { display: '冻结库存数量', name: 'freezeQuantityWH', width: 100 ,render:function(row){
                	  
                	  if(row.freezeQuantityWH == null || parseFloat(row.freezeQuantityWH) == 0){
                		  return '0.0';
                	  }else{
                		  return row.freezeQuantityWH;
                	  }
                  }}, { display: '冻结盘点数量', name: 'freezeQuantityPD', width: 100 ,render:function(row){
                	  if(row.freezeQuantityPD == null || parseFloat(row.freezeQuantityPD) == 0){
                		  return '0.0';
                	  }else{
                	  	return row.freezeQuantityPD;
                	  }
                  }},
                  { display: '冻结差异数量', name: 'freezeQuantityCY', width: 100 ,render:function(row){
                	  
                	  if(row.freezeQuantityCY == null || parseFloat(row.freezeQuantityCY) == 0){
                		  return '0.0';
                	  }else{
                		  return row.freezeQuantityCY;
                	  }
                  }},
                  { display: '盘点日期', name: 'pdDate', width: 150,render: function (item){
            		  var cdate=new Date(item.pdDate);
            		  return formatDate(cdate,"yyyy-MM-dd");
            	  }},
            	  { display: '备注', name: 'remark', width: 100}
                  ],  usePager: true,pageSize:30,
                  	enabledSort:false,
                      width: '100%', height: '98%', checkbox: false,rownumbers:true
                  });
	$("#pageloading").hide();
	
});


